#region Copyright
// Copyright (c) 2010, Kazi Manzur Rashid <kazimanzurrashid@gmail.com>.
// This source is subject to the Microsoft Public License. 
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL. 
// All other rights reserved.
#endregion

namespace LiveWriter.Plugins.SyntaxHighlighter
{
    using WindowsLive.Writer.Api;

    internal static class PropertiesExtensions
    {
        public static bool AutoLinks(this IProperties instance)
        {
            return instance.GetBoolean("auto-links", true);
        }

        public static void AutoLinks(this IProperties instance, bool value)
        {
            instance.SetBoolean("auto-links", value);
        }

        public static bool Collapse(this IProperties instance)
        {
            return instance.GetBoolean("collapse", false);
        }

        public static void Collapse(this IProperties instance, bool value)
        {
            instance.SetBoolean("collapse", value);
        }

        public static int FirstLine(this IProperties instance)
        {
            return instance.GetInt("first-line", 1);
        }

        public static void FirstLine(this IProperties instance, int value)
        {
            instance.SetInt("first-line", value);
        }

        public static bool Gutter(this IProperties instance)
        {
            return instance.GetBoolean("gutter", true);
        }

        public static void Gutter(this IProperties instance, bool value)
        {
            instance.SetBoolean("gutter", value);
        }

        public static bool HtmlScript(this IProperties instance)
        {
            return instance.GetBoolean("html-script", false);
        }

        public static void HtmlScript(this IProperties instance, bool value)
        {
            instance.SetBoolean("html-script", value);
        }

        public static bool SmartTabs(this IProperties instance)
        {
            return instance.GetBoolean("smart-tabs", true);
        }

        public static void SmartTabs(this IProperties instance, bool value)
        {
            instance.SetBoolean("smart-tabs", value);
        }

        public static int TabSize(this IProperties instance)
        {
            return instance.GetInt("tab-size", 4);
        }

        public static void TabSize(this IProperties instance, int value)
        {
            instance.SetInt("tab-size", value);
        }

        public static bool Toolbar(this IProperties instance)
        {
            return instance.GetBoolean("toolbar", false);
        }

        public static void Toolbar(this IProperties instance, bool value)
        {
            instance.SetBoolean("toolbar", value);
        }

        public static string HighlightLines(this IProperties instance)
        {
            return instance.GetString("highlight", null);
        }

        public static void HighlightLines(this IProperties instance, string value)
        {
            instance.SetString("highlight", value);
        }
    }
}